<?php

use Phalcon\Mvc\Model;

/**
 * 系统设置-模型
 */
class Settings extends Model {

    public $key;
    public $value;

    public function initialize() {
        $this->setSource("wshop_settings");
    }

    /**
     * 获取设置值
     * @param type $key
     */
    public static function get($key) {
        $e = Settings::findFirst("key = '$key'");
        if ($e) {
            return $e->value;
        } else {
            return false;
        }
    }

}
